package com.skywolf.chem.match.service;

import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.skywolf.chem.common.sysconfig.pojo.vo.PageVO;
import com.skywolf.chem.match.common.enums.MatchOrderStatusEnum;
import com.skywolf.chem.match.common.enums.MatchPayTypeEnum;
import com.skywolf.chem.match.entity.Order;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skywolf.chem.match.params.param.MatchOrderConfirmParam;
import com.skywolf.chem.match.params.vo.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 订单详情表 服务类
 * </p>
 *
 * @author
 * @since 2021-09-24
 */
public interface IOrderService extends IService<Order> {

    /**
     * 订单确认/订单提交
     *
     * @param param
     * @param userId
     * @return
     */
    OrderConfirmVO confirm(MatchOrderConfirmParam param, Long userId);

    /**
     * 订单提交
     *
     * @param param
     * @param userId
     * @return
     */
    OrderSubmitVO submit(OrderConfirmVO param, Long userId);

    /**
     * 订单支付
     *
     * @param userId
     * @param orderId
     * @param payTypeEnum
     * @return
     */
    OrderPayVo pay(Long userId, Long orderId, MatchPayTypeEnum payTypeEnum, String source) throws Exception;

    /**
     * 关闭订单
     *
     * @param orderToken
     * @return
     */
    boolean closeOrder(String orderToken, MatchOrderStatusEnum statusEnum);

    /**
     * 根据订单状态获取订单详情
     *
     * @param status
     * @param userId
     * @return
     */
    List<OrderListQueryVo> getOrderListByStatus(Integer status, Long userId);

    /**
     * 根据订单编号获取订单详情
     *
     * @param id
     * @return
     */
    OrderInfoQueryVo orderInfoQueryVo(Long id) throws Exception;

    /**
     * 取消报名
     *
     * @param id
     */
    void cancelApply(Long id);

    /**
     * 取消订单
     *
     * @param orderId
     */
    void cancelOrder(Long orderId);
}
